package com.wish.common;

import java.util.Date;

/**
 * @author tantexian
 * @since 2016/6/24
 */
public class MyUtils {
    private static final int defaultPort = 51234;
    private static final String defaultServerAddr = "127.0.0.1";

    public static String getDefaultServerAddr() {
        return defaultServerAddr;
    }

    public static int getDefaultPort() {
        return defaultPort;
    }

    public static String getAnswer(String msg) {
        System.out.println("[Date]" + new Date() + " --The ask is : " + msg);

        if (msg.contains("hello")) {
            return "Hello, I'm the smart robot, What can I help you?";
        }
        else if (msg.contains("name")) {
            return "My name is robot.";
        }
        else if (msg.contains("time")) {
            return "Now, the time is" + new Date();
        }
        else if (msg.contains("where")) {
            return "It's a secret.";
        }
        else {
            return "I'm sorry, I can't understand you question.";
        }
    }
}
